# -*- coding: utf-8 -*-
# @Author  : Pony
# @Time    : 2021/10/26 上午11:25
# Description: 生成固定数量的客户端标识码

import redis
import json

r = redis.Redis(host='localhost', port=16379, password='123456')
num = 5  # 操作台数量

client_msg = {
    'available': [f'client_{i}' for i in range(1, num + 1)],
    'unavailable': []
}
r.set('client_msg', json.dumps(client_msg))

print(json.loads(r.get('client_msg')))
r.close()
